import { setupAxios } from "./axios";
import { setupTailwindcss } from "./tailwindcss";
import _ from "lodash"


export function setupPlugins(app){
    setupTailwindcss,
    setupAxios,
    autoRegisterComponent(app)
} 


function autoRegisterComponent(app){
    const components = import.meta.globEager('../components/form/*.vue')

    console.log(components);

    Object.keys(components).forEach(key => {
        const name = key.split('/').pop()?.split('.').shift();

        app.component(_.camelCase(name),components[key].default)
    })
}